import {v4 as uuidv4} from 'uuid'
//生成一个随机数，且每次执行不变，使游客身份不变
export const getUUID=()=>{
    //先获取本地存储id
    let uuid_token = localStorage.getItem('UUIDTOKEN')
    //如果没有则生成
    if(!uuid_token){
        //执行函数生成
        uuid_token =uuidv4()
        //在本地存储保存
        localStorage.setItem('UUIDTOKEN',uuid_token)
    }
    return uuid_token
}